package net;

import java.io.IOException;
import java.io.OutputStream;

/**
 * 网络中的客户端对象
 */
public class NetClient {
    public static void main(String[] args) throws IOException {
        //1.构建Socket对象与服务器建立连接
        java.net.Socket socket = new java.net.Socket("127.0.0.1", 8088);
        //2.获取网络输出流对象(SocketOutputStream)
        OutputStream out = socket.getOutputStream();
        //3.向服务端写数据
        out.write(1);
    }
}